<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>location</title>
		<style>
			p{
				font: 30px;
				text-align: center;
			}
			#sc{
				color: red;
			}
		</style>
	</head>
	<body>
		<input type="button" id="bnt"  value="frash"/>
		<input type="button" id="b2" value="工贸"/>
		<hr />
		<p>
			<span id="sc">5</span>秒之后跳转到工贸
		</p>
	</body>
	<script>
		var btn = document.getElementById("bnt");
		var b2 = document.getElementById("b2"); 
		btn.onclick= function(){
			var href = location.href;
			alert(href);
			location.reload();
		}
		
		b2.onclick = function(){
			/*location.href = "http://www.zjitc.net";*/
			window.open("http://www.zjitc.net");
		}
		/*定时器倒计时*/
		var stime = document.getElementById("sc");
		var init ="+"+stime.innerHTML; 
		function show_time () { /*每秒执行此方法一次*/
			init--;
			if (init<=0) {
				location.href = "http://www.zjitc.net";
			}
			stime.innerHTML = init+"";
		}
		//设置定时器
		setInterval(show_time,1000);
		
	</script>
</html>
